﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ThongTinCaNhan.aspx.cs" Inherits="HospitalManager.Site.ThongTinCaNhan" %>

<%@ Register Src="TemplatesControl.ascx" TagName="TemplatesControl" TagPrefix="uc1" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="PageHead" runat="server">
    <title>THÔNG TIN CÁ NHÂN</title>
    <uc1:TemplatesControl ID="TemplatesControl1" runat="server" />
    <script type="text/javascript">
        $(function () {
            $("#<%=txtMatKhau.ClientID%>").focus();

            $("#<%=txtNhapLaiMatKhauMoi.ClientID %>").bind("keydown", function (e) {
                if (e.which === 13) {
                    e.preventDefault();
                    $("#<%=btnLuu.ClientID %>").focus();
                }
            });

            $("#<%=txtSoDienThoai.ClientID %>").bind("keypress", function (e) {
                return (e.which !== 8 && e.which !== 0 && (e.which < 48 || e.which > 57)) ? false : true;
            });
        })
    </script>
</head>
<body style="background: url(/Templates/images/banner.jpg) no-repeat center center #EAEAEA">
    <form id="form1" runat="server">
        <div class="panel panel-primary" style="margin: 0 auto; max-width: 500px; margin-top: 200px;">
            <div class="panel-heading" style="font-weight: bold; font-size: 25px; text-align: center;">
                <a href="trang-chu" style="color: #ffffff; float: left;"><span class="glyphicon glyphicon-home"></span></a>&nbsp;THÔNG TIN CÁ NHÂN
            </div>
            <div class="panel-body">
                <div role="tabpanel">
                    <ul class="nav nav-tabs" role="tablist">
                        <li role="presentation" class="active"><a href="#tab_thongtincanhan" role="tab" data-toggle="tab">Thông tin cá nhân</a></li>
                        <li role="presentation"><a href="#tab_doimatkhau" role="tab" data-toggle="tab">Đổi mật khẩu</a></li>
                    </ul>
                    <div class="tab-content">
                        <div role="tabpanel" class="tab-pane active" id="tab_thongtincanhan">
                            <div class="form-horizontal">
                                <div class="form-group" style="margin-top: 10px;">
                                    <label class="col-sm-4 control-label">
                                        Họ và tên</label>
                                    <div class="col-sm-8">
                                        <asp:TextBox ID="txtHoTen" runat="server" CssClass="form-control" placeholder="Họ và tên"></asp:TextBox>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-4 control-label">
                                        Địa chỉ</label>
                                    <div class="col-sm-8">
                                        <asp:TextBox ID="txtDiaChi" runat="server" CssClass="form-control" placeholder="Địa chỉ"></asp:TextBox>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-4 control-label">
                                        Số điện thoại</label>
                                    <div class="col-sm-8">
                                        <asp:TextBox ID="txtSoDienThoai" runat="server" CssClass="form-control" placeholder="Số điện thoại" MaxLength="11"></asp:TextBox>
                                    </div>
                                </div>
                                <div class="form-group" style="margin-bottom: 0;">
                                    <div class="col-sm-offset-4 col-sm-8">
                                        <asp:Button ID="btnLuu_ThongTinCaNhan" runat="server" Text="Lưu" class="btn btn-info"
                                            OnClientClick="validation_form_thongtincanhan()" OnClick="btnLuu_ThongTinCaNhan_Click" />
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div role="tabpanel" class="tab-pane" id="tab_doimatkhau">
                            <div class="form-horizontal">
                                <div class="form-group" style="margin-top: 10px;">
                                    <label class="col-sm-4 control-label">
                                        Mật khẩu cũ</label>
                                    <div class="col-sm-8">
                                        <asp:TextBox ID="txtMatKhau" runat="server" CssClass="form-control" placeholder="Mật khẩu cũ" TextMode="Password"></asp:TextBox>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-4 control-label">
                                        Mật khẩu mới</label>
                                    <div class="col-sm-8">
                                        <asp:TextBox ID="txtMatKhauMoi" runat="server" CssClass="form-control" placeholder="Mật khẩu mới" TextMode="Password"></asp:TextBox>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-4 control-label">
                                        Nhập lại mật khẩu mới</label>
                                    <div class="col-sm-8">
                                        <asp:TextBox ID="txtNhapLaiMatKhauMoi" runat="server" CssClass="form-control" placeholder="Mật khẩu mới" TextMode="Password"></asp:TextBox>
                                    </div>
                                </div>
                                <div class="form-group" style="margin-bottom: 0;">
                                    <div class="col-sm-offset-4 col-sm-8">
                                        <asp:Button ID="btnLuu" runat="server" Text="Lưu" class="btn btn-info"
                                            OnClick="btnLuu_Click" OnClientClick="validation_form()" />
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
    <script type="text/javascript">
        function validation_form() {
            $("#<%=txtMatKhau.ClientID %>").rules("add", {
                required: true,
                messages: {
                    required: MsErrorEmpty
                }
            });

            $("#<%=txtMatKhauMoi.ClientID %>").rules("add", {
                required: true,
                messages: {
                    required: MsErrorEmpty
                }
            });

            $("#<%=txtNhapLaiMatKhauMoi.ClientID %>").rules("add", {
                required: true,
                equalTo: "#<%=txtMatKhauMoi.ClientID %>",
                messages: {
                    required: MsErrorEmpty,
                    equalTo: "Mật khẩu mới không giống nhau!"
                }
            });
        }

        function validation_form_thongtincanhan() {
            $("#<%=txtHoTen.ClientID %>").rules("add", {
                required: true,
                messages: {
                    required: MsErrorEmpty
                }
            });
        }
    </script>
</body>
</html>
